<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitWithdrawUpdate extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('withdraw_records', function (Blueprint $table) {
            $table->string('withdraw_type', 20)->comment('提现方式: wechat_pay_auto微信零钱 wechat_pay转帐、 alipay支付宝、 bank银行')->change();

            $table->char('number', 30)->index()->comment('提现编号'); 

            $table->tinyInteger('auto_pay_status')->default(0)->index()->comment('0为无需自动转帐  1为已成功转帐  2需要人工审核   3为自动转帐失败  4为待处理'); 
            $table->timestamp('auto_paid_at')->nullable()->comment('自动转帐的时间'); 
            $table->json('auto_pay_info')->nullable()->comment('自动转帐的相关记录'); 

            $table->string('bank_name', 50)->nullable()->comment('银行名'); 
            $table->string('bank_account_number', 50)->nullable()->comment('银行卡号'); 
            $table->string('bank_account_name', 50)->nullable()->comment('银行卡用户名'); 
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
